<?php
    class SearchViewModel extends ViewModel{
        protected $_validate=array(
        array('score','number','分数必须为数字!',),
    );
         public $viewFields=array(
                 'Score'=>array('itemid','grade','term','subject','score'),
                 'Student'=>array('name','stu_id','status','updatetime','_on'=>'Score.itemid=Student.itemid'),
                 'Grade'=>array('grade'=>'grades','_on'=>'Score.grade=Grade.itemid'),
                 'Term'=>array('term'=>'terms','_on'=>'Score.term=Term.itemid'),
                 'Subject'=>array('subject'=>'subjects','_on'=>'Score.subject=Subject.itemid'),
         );
   }
?>